<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link href="${ctxPath!}/layui/css/layui.css" rel="stylesheet" type="text/css">
    <% include("/templates/common/dialog.html"){} %>
</head>

    <div class="layui-form-item" style="margin-left: 110px;">
    <% if(ids == null || ids == "" ){ %>
        <label class="layui-form-label" style="width: 250px; text-align: left;">没有选中客户</label>
    <% }else{ %>
        <label class="layui-form-label" style="width: 250px; text-align: left;">选中${firstClientName}等${number}名客户</label>
    <% } %>
    </div>
<div style="padding:10px 50px 10px 10px">
    <form id="careRecordForm" method="post" action="${ctxPath!}/sys/careRecord/edit" class="layui-form layui-row">
        <div class="layui-col-md6">
            <input type="hidden" name="ids" value="${ids}"/>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label"></label>
            <div class="layui-input-block">
                <textarea name="content" placeholder="请输入发送信息" class="layui-textarea" lay-verify="required"></textarea>
            </div>
        </div>
        <div class="layui-form-item" style="text-align: center;">
            <div class="layui-input-block">
                <button id="submitButton" class="layui-btn" lay-submit lay-filter="*">发送</button>
                <button type="button" class="layui-btn layui-btn-primary" onclick="closeAll()">取消</button>
            </div>
        </div>
    </form>
</div>
<script src="${ctxPath!}/jquery/jquery.min.js"></script>
<script src="${ctxPath!}/layui/layui.js"></script>
<script src="${ctxPath!}/jqgrid/jquery.jqGrid.minffe4.js?0820"></script>
<script src="${ctxPath!}/jqgrid/myjqGrid.js?v=1.0.1"></script>
<script type="text/javascript">
    layui.use(['form','laydate','layer'], function(){
        var form = layui.form;
        var laydate = layui.laydate;
        form.on('submit(*)', function(data){
            var index = layer.msg('数据提交中，请稍候',{icon: 16,time:false,shade:0.8});
            $.post($("#careRecordForm").attr("action"), $("#careRecordForm").serialize(), function(data){
                layer.close(index);
                layer.alert("邮件正在发送,请等待30秒以上后查看发送记录!", {
                    skin: 'layer-ext-moon'
                },function () {
                    parent.layer.closeAll();
                });
            });
            return false; //阻止表单跳转。
        });
    });
    function closeAll() {
        parent.layer.closeAll();
    }
</script>